#include "Common/Unit/Exception.h"
#include <string.h>

namespace Common
{

	CNullHandleException::CNullHandleException(const CHAR* file , INT line )
	:CException()
	{
		std::ostringstream str;
		str << "CNullHandleException " << file << "(" << line << ")";
		_str = str.str();
	}
	CNullHandleException::~CNullHandleException()
	{
	}

	const std::string CMyException::ToString()
	{
		std::ostringstream stream;
		stream<<"[Tid:"<<_tId<<"][Dt:"<<_dt.GetStrTime()<<"][File:"<<_file<<"]\n"
			"====================================Detail==================================\n";
		for ( INT i = _exceptionInfoSeq.size() - 1; i >= 0; i-- )
		{
			stream<<"\t[code:"<<_exceptionInfoSeq[i]._code;
			stream<<"][msg :"<<_exceptionInfoSeq[i]._msg;
			stream<<"][line:"<<_exceptionInfoSeq[i]._line;
			stream<<"][func:"<<_exceptionInfoSeq[i]._func<<"]\n";
		}
		stream<<"====================================End=====================================\n";
		return stream.str();
	}
}